package main;

import interfaces.Error;
import interfaces.ErrorList;

import java.util.ArrayList;
import java.util.Collection;

public class ErrorListImpl implements ErrorList {
	private Collection<Error> errorList;
	
	public ErrorListImpl (){
		errorList = new ArrayList<Error>();
	}
	
	@Override
	public void put (Error e){
		getErrorList().add(e);
	}

	@Override
	public Collection<Error> getErrorList() {
		return errorList;
	}
	
	@Override
	public String toString (){
		Collection<Error> errores = getErrorList();
		String s = "";
		for (Error e : errores){
			s += e.getRespuesta() + " --> " + e.getTermino() + ": " + e.getAcepciones() + "\n";
		}
		return s;
	}
}
